package com.cp.dao;

import com.cp.repository.AdjudgmentRelationWord;
import com.cp.repository.AdjudgmentWord;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AdjudgmentRelationWordMapper {


	@Select("SELECT * FROM adjudgment_relation_word WHERE conviction_id = #{convictionId}")
	@Results({
			@Result(id = true, column = "id", property = "id"),
			@Result(property = "content", column = "content"),
			@Result(property = "conviction", column = "conviction_id", one = @One(select="com.cp.dao.ConvictionMapper.getById"))
	})
	List<AdjudgmentRelationWord> getByConvictionId(Integer convictionId);


	@Select("SELECT * FROM adjudgment_relation_word WHERE id = #{id}")
	@Results({
			@Result(id = true, property = "id", column = "id"),
			@Result(property = "content", column = "content"),
			@Result(property = "conviction", column = "conviction_id", one = @One(select="com.cp.dao.ConvictionMapper.getById"))
	})
	AdjudgmentRelationWord getById(Integer id);
}
